import { defineStore } from "pinia";
let userInfoStore = defineStore({
    id: 'user',
    state: () => {
        return {
            token: ''
        }

    },
    action: {
        setToken(token: string) {
            this.token = token
        }

    },
    getters: () => {

    },
    persist: {  //持久存储
        enabled: true,
        strategies: [
            {
                key: "user",
                storage: localStorage,
            },
        ],
    },
}

)
export default userInfoStore